<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>新增按钮</title>
</head>
 <body>
 <script type="text/javascript">
 	var winBtnAdd = new Windows("btn_add");
 	var oBtnAdd = {
 		initForm : function(){
 			winBtnAdd.find("#btnAddForm").form({
	 			url:'$!basePath/admin/button/doAdd',
	 			onSubmit: function(){
			    	var pass = winBtnAdd.find('#btnAddForm').form("validate");
			    	if(pass){
			    		winBtnAdd.find("#ok").linkbutton("loading");
			    	}
			    	return pass; 
			    },
			    success:function(data){
			   		var result = jQuery.parseJSON(data);   
			        if(result.success == true){
			       		top.Notiy.success("添加成功!");
		        		winBtnAdd.setReturnValue(true);
						winBtnAdd.close();
			        }else{
			        	top.Dialog.alert("提示",result.error,"error");
			        }
			        winBtnAdd.find("#ok").linkbutton("reset");
			    }
 			});
 		},
 		ok : function(){
 			winBtnAdd.find('#btnAddForm').submit();
 		},
 		cancel : function(){
 			winBtnAdd.close();
 		}
 	}
 	$(function(){
 		oBtnAdd.initForm();
 	});
 </script>
 <div class="easyui-layout" data-options="fit:true">
	 <div data-options="region:'center',border:false">
	 	<form id="btnAddForm" method="post" style="padding-top:10px;padding-left:20px;">
	 		<table width="90%" style="line-height: 25px;">
				<tr>
					<td>按钮名称:</td>
					<td>
						<input type="text" class="easyui-validatebox" name="name" maxlength="50" data-options="required:true" style="width: 90%;"/>
					</td>
				</tr>
				<tr>
					<td>字段ID:</td>
					<td>
						<input type="text" class="easyui-validatebox" name="field" maxlength="50" data-options="required:true" style="width: 90%;"/>
					</td>
				</tr>
				<tr>
					<td>按钮样式:</td>
					<td>
						<input type="text" class="easyui-validatebox" name="icon" maxlength="50" style="width: 90%;"/>
					</td>
				</tr>
				<tr>
					<td>是否启用：</td>
					<td>
						<label>启用</label>
						<input type="radio" name="enabled" value="0" checked="checked"/>
						<label>不启用</label>
						<input type="radio" name="enabled" value="1"/>
					</td>
				</tr>
			</table>
		</form>
	 </div>
	 <!--Change Button Text-->
	 <div data-options="region:'south',border:false">
	 	<div class="dialog-button">
			<a id="ok" class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="oBtnAdd.ok()">确定</a>
			<a id="cancel" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="oBtnAdd.cancel()">取消</a>
		</div>
	</div>
 </div>
  </body>
</html>